package com.xbongbong.saas.model;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.PayPlanSubDataEntity;
import com.xbongbong.saas.domain.entity.PaymentSubDataEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @author: shian
 * @date : 2020/9/18
 */
public interface PayPlanSubDataModel extends IModel<PayPlanSubDataEntity> {

    @Override
    Integer insert(PayPlanSubDataEntity entity) throws XbbException;

    @Override
    Integer update(PayPlanSubDataEntity entity) throws XbbException;

    @Override
    List<PayPlanSubDataEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer insertBatch(List<PayPlanSubDataEntity> payPlanSubDataEntities) throws XbbException;

    List<PayPlanSubDataEntity> getByDataId(Long dataId, String corpid);

    List<PayPlanSubDataEntity> getByDataIds(List<Long> dataIds, String corpid, DelEnum delEnum);

    Integer updateBatch(List<UpdateDataEntity> updateDataList, String corpid) throws XbbException;

    Integer deleteBatch(String corpid, List<PayPlanSubDataEntity> entities, WriteRequest.RefreshPolicy refreshPolicy) throws XbbException;


    Integer deleteByDataId(Long dataId, String corpid) throws XbbException;

    Integer deleteBatchByDataId(List<Long> dataIds, String corpid, DelEnum delEnum) throws XbbException;

    void restoreBatch(List<Long> dataIds, String corpid) throws XbbException;

    /**
     * @param updateList
     * @param corpid
     * @return java.lang.Integer
     * @author 吴峰
     * @date 2020/10/15 15:28
     * @throws XbbException
     */
    Integer updateBatchByEntity(List<PayPlanSubDataEntity> updateList, String corpid) throws XbbException;

    /**
     * 根据id删除子表单数据
     * @param idMap
     * @param corpid
     * @return java.lang.Integer
     * @author 吴峰
     * @date 2020/10/15 15:11
     * @throws XbbException
     */
    Integer deleteBatchByIdIn(Map<Long, Long> idMap, String corpid) throws XbbException;

    Integer updateDel(List<PayPlanSubDataEntity> updateDelList, String corpid, WriteRequest.RefreshPolicy refreshPolicy, DelEnum delEnum) throws XbbException;
}
